import {
    Column,
    CreateDateColumn,
    Entity,
    PrimaryGeneratedColumn,
    UpdateDateColumn,
} from 'typeorm';

@Entity('userinfo')
export class userinfoEntity {
    @PrimaryGeneratedColumn()
    id: number;

    // 用户名称
    @Column()
    username: string;

    // 手机号
    @Column({ length: 11, nullable: true })
    phone: string;

    // 年龄
    @Column({ length: 3, nullable: true })
    age: string;

    // 地址 
    @Column()
    address: string;

    @CreateDateColumn({
        type: 'timestamp',
        comment: '创建时间',
        name: 'create_time',
    })
    createTime: Date;

    @UpdateDateColumn({
        type: 'timestamp',
        comment: '更新时间',
        name: 'update_time',
    })
    updateTime: Date;
}
